import React, { lazy } from "react";
import MainLayout from "../components/mainLayout";
import { RouteRawState } from "../types";
import {
  HomeOutlined,
  UnorderedListOutlined,
  FileAddOutlined,
  SettingOutlined,
} from "@ant-design/icons";

const Home = lazy(() => import("../views/home"));
const ListManage = lazy(() => import("../views/listManage"));
const ListAdd = lazy(() => import("../views/listAdd"));
const UserSet = lazy(() => import("../views/userSet"));
const Login = lazy(() => import("../views/login"));
const NotPromiss = lazy(() => import("../views/403"));

export const _ROUTES_LIST: RouteRawState[] = [
  {
    element: (
      <MainLayout>
        <Home></Home>
      </MainLayout>
    ),
    path: "/",
    meta: {
      title: "首页",
      icon: <HomeOutlined />,
    },
  },
  {
    element: (
      <MainLayout>
        <ListManage></ListManage>
      </MainLayout>
    ),
    path: "/list/manage",
    meta: {
      title: "列表管理",
      icon: <UnorderedListOutlined />,
      roles: ["admin", "user"],
    },
  },
  {
    element: (
      <MainLayout>
        <ListAdd></ListAdd>
      </MainLayout>
    ),
    path: "/list/add",
    meta: {
      title: "列表添加",
      icon: <FileAddOutlined />,
      roles: ["test", "user", "admin"],
    },
  },
  {
    element: <Login></Login>,
    path: "/login",
    meta: {
      title: "登录",
      hidden: true,
    },
  },
  {
    element: (
      <MainLayout>
        <UserSet></UserSet>
      </MainLayout>
    ),
    path: "/user/set",
    meta: {
      title: "用户设置",
      icon: <SettingOutlined />,
      roles: ["admin", "test", "user"],
    },
  },
  
  {
    element: <MainLayout>
      <NotPromiss></NotPromiss>
    </MainLayout>,
    path: '/403',
    meta: {
      title: 'not promiss',
      hidden: true
    }
  }
];
